using HKB.Common;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Diagnostics;
namespace HKB.Data.Dal.S_MessageTableAdapters
{
	[GeneratedCode("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), DataObject(true), HelpKeyword("vs.data.TableAdapter"), Designer("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DesignerCategory("code"), ToolboxItem(true)]
	public class HLShop_MessageTableAdapter : Component
	{
		private SqlDataAdapter _adapter;
		private SqlConnection _connection;
		private SqlCommand[] _commandCollection;
		private bool _clearBeforeFill;
		[System.Diagnostics.DebuggerNonUserCode]
		private SqlDataAdapter Adapter
		{
			get
			{
				if (this._adapter == null)
				{
					this.InitAdapter();
				}
				return this._adapter;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		internal SqlConnection Connection
		{
			get
			{
				if (this._connection == null)
				{
					this.InitConnection();
				}
				return this._connection;
			}
			set
			{
				this._connection = value;
				if (this.Adapter.InsertCommand != null)
				{
					this.Adapter.InsertCommand.Connection = value;
				}
				if (this.Adapter.DeleteCommand != null)
				{
					this.Adapter.DeleteCommand.Connection = value;
				}
				if (this.Adapter.UpdateCommand != null)
				{
					this.Adapter.UpdateCommand.Connection = value;
				}
				for (int i = 0; i < this.CommandCollection.Length; i++)
				{
					if (this.CommandCollection[i] != null)
					{
						this.CommandCollection[i].Connection = value;
					}
				}
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		protected SqlCommand[] CommandCollection
		{
			get
			{
				if (this._commandCollection == null)
				{
					this.InitCommandCollection();
				}
				return this._commandCollection;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public bool ClearBeforeFill
		{
			get
			{
				return this._clearBeforeFill;
			}
			set
			{
				this._clearBeforeFill = value;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public HLShop_MessageTableAdapter()
		{
			this.ClearBeforeFill = true;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitAdapter()
		{
			this._adapter = new SqlDataAdapter();
			DataTableMapping dataTableMapping = new DataTableMapping();
			dataTableMapping.SourceTable = "Table";
			dataTableMapping.DataSetTable = "HLShop_Message";
			dataTableMapping.ColumnMappings.Add("M_ID", "M_ID");
			dataTableMapping.ColumnMappings.Add("M_ReplayID", "M_ReplayID");
			dataTableMapping.ColumnMappings.Add("M_Type", "M_Type");
			dataTableMapping.ColumnMappings.Add("M_ProductID", "M_ProductID");
			dataTableMapping.ColumnMappings.Add("M_ShopID", "M_ShopID");
			dataTableMapping.ColumnMappings.Add("M_DateTime", "M_DateTime");
			dataTableMapping.ColumnMappings.Add("M_UserID", "M_UserID");
			dataTableMapping.ColumnMappings.Add("M_Status", "M_Status");
			dataTableMapping.ColumnMappings.Add("M_Content", "M_Content");
			dataTableMapping.ColumnMappings.Add("M_ReceiverID", "M_ReceiverID");
			dataTableMapping.ColumnMappings.Add("M_SenderName", "M_SenderName");
			dataTableMapping.ColumnMappings.Add("M_ReceiverName", "M_ReceiverName");
			dataTableMapping.ColumnMappings.Add("M_UserType", "M_UserType");
			dataTableMapping.ColumnMappings.Add("M_RequestID", "M_RequestID");
			this._adapter.TableMappings.Add(dataTableMapping);
			this._adapter.DeleteCommand = new SqlCommand();
			this._adapter.DeleteCommand.Connection = this.Connection;
			this._adapter.DeleteCommand.CommandText = "DELETE FROM [HLShop_Message] WHERE (([M_ID] = @Original_M_ID))";
			this._adapter.DeleteCommand.CommandType = CommandType.Text;
			this._adapter.DeleteCommand.Parameters.Add(new SqlParameter("@Original_M_ID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_ID", DataRowVersion.Original, false, null, "", "", ""));
			this._adapter.InsertCommand = new SqlCommand();
			this._adapter.InsertCommand.Connection = this.Connection;
			this._adapter.InsertCommand.CommandText = "INSERT INTO [HLShop_Message] ([M_ReplayID], [M_Type], [M_ProductID], [M_ShopID], [M_DateTime], [M_UserID], [M_Status], [M_Content], [M_ReceiverID], [M_SenderName], [M_ReceiverName], [M_UserType], [M_RequestID]) VALUES (@M_ReplayID, @M_Type, @M_ProductID, @M_ShopID, @M_DateTime, @M_UserID, @M_Status, @M_Content, @M_ReceiverID, @M_SenderName, @M_ReceiverName, @M_UserType, @M_RequestID);\r\nSELECT M_ID, M_ReplayID, M_Type, M_ProductID, M_ShopID, M_DateTime, M_UserID, M_Status, M_Content, M_ReceiverID, M_SenderName, M_ReceiverName, M_UserType, M_RequestID FROM HLShop_Message WHERE (M_ID = SCOPE_IDENTITY())";
			this._adapter.InsertCommand.CommandType = CommandType.Text;
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_ReplayID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_ReplayID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_Type", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_Type", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_ProductID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_ProductID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_ShopID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_ShopID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "M_DateTime", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_UserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_Status", SqlDbType.Bit, 0, ParameterDirection.Input, 0, 0, "M_Status", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_Content", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "M_Content", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_ReceiverID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_ReceiverID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_SenderName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "M_SenderName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_ReceiverName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "M_ReceiverName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_UserType", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "M_UserType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@M_RequestID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_RequestID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand = new SqlCommand();
			this._adapter.UpdateCommand.Connection = this.Connection;
			this._adapter.UpdateCommand.CommandText = "UPDATE [HLShop_Message] SET [M_ReplayID] = @M_ReplayID, [M_Type] = @M_Type, [M_ProductID] = @M_ProductID, [M_ShopID] = @M_ShopID, [M_DateTime] = @M_DateTime, [M_UserID] = @M_UserID, [M_Status] = @M_Status, [M_Content] = @M_Content, [M_ReceiverID] = @M_ReceiverID, [M_SenderName] = @M_SenderName, [M_ReceiverName] = @M_ReceiverName, [M_UserType] = @M_UserType, [M_RequestID] = @M_RequestID WHERE (([M_ID] = @Original_M_ID));\r\nSELECT M_ID, M_ReplayID, M_Type, M_ProductID, M_ShopID, M_DateTime, M_UserID, M_Status, M_Content, M_ReceiverID, M_SenderName, M_ReceiverName, M_UserType, M_RequestID FROM HLShop_Message WHERE (M_ID = @M_ID)";
			this._adapter.UpdateCommand.CommandType = CommandType.Text;
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_ReplayID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_ReplayID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_Type", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_Type", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_ProductID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_ProductID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_ShopID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_ShopID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "M_DateTime", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_UserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_Status", SqlDbType.Bit, 0, ParameterDirection.Input, 0, 0, "M_Status", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_Content", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "M_Content", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_ReceiverID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_ReceiverID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_SenderName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "M_SenderName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_ReceiverName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "M_ReceiverName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_UserType", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "M_UserType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_RequestID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_RequestID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Original_M_ID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "M_ID", DataRowVersion.Original, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@M_ID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_ID", DataRowVersion.Current, false, null, "", "", ""));
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitConnection()
		{
			this._connection = new SqlConnection();
			this._connection.ConnectionString = Conn.CurrenConnectionStrings;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitCommandCollection()
		{
			this._commandCollection = new SqlCommand[13];
			this._commandCollection[0] = new SqlCommand();
			this._commandCollection[0].Connection = this.Connection;
			this._commandCollection[0].CommandText = "SELECT M_ID, M_ReplayID, M_Type, M_ProductID, M_ShopID, M_DateTime, M_UserID, \r\n      M_Status, M_Content, M_ReceiverID, M_SenderName, M_ReceiverName, \r\n      M_UserType,M_RequestID\r\nFROM HLShop_Message";
			this._commandCollection[0].CommandType = CommandType.Text;
			this._commandCollection[1] = new SqlCommand();
			this._commandCollection[1].Connection = this.Connection;
			this._commandCollection[1].CommandText = "PR_DeleteMessage";
			this._commandCollection[1].CommandType = CommandType.StoredProcedure;
			this._commandCollection[1].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[1].Parameters.Add(new SqlParameter("@M_ID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[2] = new SqlCommand();
			this._commandCollection[2].Connection = this.Connection;
			this._commandCollection[2].CommandText = "SELECT M_ID, M_ReplayID, M_Type, M_ProductID, M_ShopID, M_DateTime, M_UserID, \r\n      M_Status, M_Content, M_ReceiverID, M_SenderName, M_ReceiverName, \r\n      M_UserType,M_RequestID\r\nFROM HLShop_Message\r\nWhere M_ID=@M_ID";
			this._commandCollection[2].CommandType = CommandType.Text;
			this._commandCollection[2].Parameters.Add(new SqlParameter("@M_ID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_ID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3] = new SqlCommand();
			this._commandCollection[3].Connection = this.Connection;
			this._commandCollection[3].CommandText = "\r\n                      SELECT HLShop_Message_1.M_Content AS R_Content,\r\n                      HLShop_Message_1.M_DateTime AS R_DateTime,\r\n                      HLShop_Message_1.M_ReceiverID AS ReceiverID,\r\n                      HLShop_Message_1.M_UserID As SenderID,\r\n                      HLShop_Message_1.M_ID AS R_ID,\r\n                      HLShop_Message_1.M_SenderName AS ReceiverName, HLShop_Message.*\r\n                      FROM HLShop_Message LEFT OUTER JOIN\r\n                      HLShop_Message AS HLShop_Message_1 ON\r\n                      HLShop_Message_1.M_ReplayID = HLShop_Message.M_ID\r\n                      WHERE (HLShop_Message.M_ShopID =@ShopID) AND\r\n                      (HLShop_Message.M_Type = 1) AND (HLShop_Message.M_ReplayID = 0)\r\n                      ORDER BY HLShop_Message.M_DateTime DESC\r\n\r\n\r\n                    ";
			this._commandCollection[3].CommandType = CommandType.Text;
			this._commandCollection[3].Parameters.Add(new SqlParameter("@ShopID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_ShopID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4] = new SqlCommand();
			this._commandCollection[4].Connection = this.Connection;
			this._commandCollection[4].CommandText = "SELECT M_Content, M_DateTime, M_ID, M_ProductID, M_ReceiverID, M_ReceiverName, M_ReplayID, M_RequestID, M_SenderName, M_ShopID, M_Status, M_Type, M_UserID, M_UserType FROM HLShop_Message WHERE (M_ReplayID = @M_ID)";
			this._commandCollection[4].CommandType = CommandType.Text;
			this._commandCollection[4].Parameters.Add(new SqlParameter("@M_ID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_ReplayID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5] = new SqlCommand();
			this._commandCollection[5].Connection = this.Connection;
			this._commandCollection[5].CommandText = "\r\n                      SELECT HLShop_Message_1.M_Content AS R_Content,\r\n                      HLShop_Message_1.M_DateTime AS R_DateTime,\r\n                      HLShop_Message_1.M_ReceiverID AS ReceiverID,\r\n                      HLShop_Message_1.M_UserID As SenderID,\r\n                      HLShop_Message_1.M_SenderName AS ReceiverName, HLShop_Message.*\r\n                      FROM HLShop_Message LEFT OUTER JOIN\r\n                      HLShop_Message AS HLShop_Message_1 ON\r\n                      HLShop_Message_1.M_ReplayID = HLShop_Message.M_ID\r\n                      WHERE (HLShop_Message.M_ProductID = @ProductID) AND\r\n                      (HLShop_Message.M_Type = 0) AND (HLShop_Message.M_ReplayID = 0)";
			this._commandCollection[5].CommandType = CommandType.Text;
			this._commandCollection[5].Parameters.Add(new SqlParameter("@ProductID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_ProductID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6] = new SqlCommand();
			this._commandCollection[6].Connection = this.Connection;
			this._commandCollection[6].CommandText = "\r\nSELECT HLShop_Message_1.M_Content AS R_Content, \r\n      HLShop_Message_1.M_DateTime AS R_DateTime, \r\n      HLShop_Message_1.M_ReceiverID AS ReceiverID, \r\n      HLShop_Message_1.M_ReceiverName AS ReceiverName, HLShop_Message.*\r\nFROM HLShop_Message LEFT OUTER JOIN\r\n      HLShop_Message AS HLShop_Message_1 ON \r\n      HLShop_Message_1.M_ReplayID = HLShop_Message.M_ID\r\nWHERE (HLShop_Message.M_RequestID = @RequestID) AND \r\n      (HLShop_Message.M_Type = 2) AND (HLShop_Message.M_ReplayID = 0)";
			this._commandCollection[6].CommandType = CommandType.Text;
			this._commandCollection[6].Parameters.Add(new SqlParameter("@RequestID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_RequestID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[7] = new SqlCommand();
			this._commandCollection[7].Connection = this.Connection;
			this._commandCollection[7].CommandText = "SELECT HLShop_Message_1.M_Content AS R_Content, \r\n      HLShop_Message_1.M_DateTime AS R_DateTime, \r\n      HLShop_Message_1.M_ReceiverID AS ReceiverID, \r\n      HLShop_Message_1.M_ReceiverName AS ReceiverName, HLShop_Message.*\r\nFROM HLShop_Message LEFT OUTER JOIN\r\n      HLShop_Message AS HLShop_Message_1 ON \r\n      HLShop_Message_1.M_ReplayID = HLShop_Message.M_ID\r\nWHERE (HLShop_Message.M_ShopID =@ShopID) AND \r\n      (HLShop_Message.M_Type = 1) AND (HLShop_Message.M_ReplayID = 0) AND (DATEDIFF(day,HLShop_Message.M_DateTime,getdate())<=30)";
			this._commandCollection[7].CommandType = CommandType.Text;
			this._commandCollection[7].Parameters.Add(new SqlParameter("@ShopID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_ShopID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8] = new SqlCommand();
			this._commandCollection[8].Connection = this.Connection;
			this._commandCollection[8].CommandText = "pr_SearchMessage";
			this._commandCollection[8].CommandType = CommandType.StoredProcedure;
			this._commandCollection[8].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@M_Status", SqlDbType.VarChar, 10, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@M_Content", SqlDbType.VarChar, 100, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@M_BeginDate", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@M_endDate", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@M_productid", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@M_shopid", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[8].Parameters.Add(new SqlParameter("@M_Type", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[9] = new SqlCommand();
			this._commandCollection[9].Connection = this.Connection;
			this._commandCollection[9].CommandText = "pr_GetBuyerMessage";
			this._commandCollection[9].CommandType = CommandType.StoredProcedure;
			this._commandCollection[9].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[9].Parameters.Add(new SqlParameter("@Type", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[9].Parameters.Add(new SqlParameter("@userType", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[9].Parameters.Add(new SqlParameter("@userID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[10] = new SqlCommand();
			this._commandCollection[10].Connection = this.Connection;
			this._commandCollection[10].CommandText = "SELECT M_Content, M_DateTime, M_ID, M_ProductID, M_ReceiverID, M_ReceiverName, M_ReplayID, M_RequestID, M_SenderName, M_ShopID, M_Status, M_Type, M_UserID, M_UserType FROM HLShop_Message WHERE (M_Type = @Type) AND (M_ReceiverID = @SalerID)";
			this._commandCollection[10].CommandType = CommandType.Text;
			this._commandCollection[10].Parameters.Add(new SqlParameter("@Type", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_Type", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[10].Parameters.Add(new SqlParameter("@SalerID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_ReceiverID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11] = new SqlCommand();
			this._commandCollection[11].Connection = this.Connection;
			this._commandCollection[11].CommandText = "INSERT INTO HLShop_Message\r\n      (M_Type, M_ProductID, M_ShopID, M_UserID, M_Status, M_Content, M_ReplayID, \r\n      M_SenderName, M_DateTime, M_ReceiverID, M_ReceiverName, M_UserType,M_RequestID)\r\nVALUES (@M_Type,@M_Productid,@M_ShopID,@M_UserID,@M_Status,@M_Content, \r\n      0,@M_SenderName, GETDATE(),@M_ReceiverID,@M_ReceiverName,@M_UserType,@M_RequestID)";
			this._commandCollection[11].CommandType = CommandType.Text;
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_Type", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_Type", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_Productid", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_ProductID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_ShopID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_ShopID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_UserID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_Status", SqlDbType.Bit, 1, ParameterDirection.Input, 0, 0, "M_Status", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_Content", SqlDbType.VarChar, 800, ParameterDirection.Input, 0, 0, "M_Content", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_SenderName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "M_SenderName", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_ReceiverID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_ReceiverID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_ReceiverName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "M_ReceiverName", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_UserType", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "M_UserType", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[11].Parameters.Add(new SqlParameter("@M_RequestID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "M_RequestID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[12] = new SqlCommand();
			this._commandCollection[12].Connection = this.Connection;
			this._commandCollection[12].CommandText = "Pr_ReplayMessage";
			this._commandCollection[12].CommandType = CommandType.StoredProcedure;
			this._commandCollection[12].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[12].Parameters.Add(new SqlParameter("@M_Content", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[12].Parameters.Add(new SqlParameter("@M_UserID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[12].Parameters.Add(new SqlParameter("@M_ID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[12].Parameters.Add(new SqlParameter("@M_SenderName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
		}
		[DataObjectMethod(DataObjectMethodType.Select, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Message.HLShop_MessageDataTable GetAllMessage()
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			S_Message.HLShop_MessageDataTable hLShop_MessageDataTable = new S_Message.HLShop_MessageDataTable();
			this.Adapter.Fill(hLShop_MessageDataTable);
			return hLShop_MessageDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Message.HLShop_MessageDataTable GetMessageByMessageID(int M_ID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[2];
			this.Adapter.SelectCommand.Parameters[0].Value = M_ID;
			S_Message.HLShop_MessageDataTable hLShop_MessageDataTable = new S_Message.HLShop_MessageDataTable();
			this.Adapter.Fill(hLShop_MessageDataTable);
			return hLShop_MessageDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Message.HLShop_MessageDataTable GetAllMessageByShopID(int? ShopID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[3];
			if (ShopID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = ShopID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			S_Message.HLShop_MessageDataTable hLShop_MessageDataTable = new S_Message.HLShop_MessageDataTable();
			this.Adapter.Fill(hLShop_MessageDataTable);
			return hLShop_MessageDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Message.HLShop_MessageDataTable GetM_IDByReplayID(int? M_ID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[4];
			if (M_ID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = M_ID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			S_Message.HLShop_MessageDataTable hLShop_MessageDataTable = new S_Message.HLShop_MessageDataTable();
			this.Adapter.Fill(hLShop_MessageDataTable);
			return hLShop_MessageDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Message.HLShop_MessageDataTable GetMessageByProductID(int? ProductID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[5];
			if (ProductID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = ProductID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			S_Message.HLShop_MessageDataTable hLShop_MessageDataTable = new S_Message.HLShop_MessageDataTable();
			this.Adapter.Fill(hLShop_MessageDataTable);
			return hLShop_MessageDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Message.HLShop_MessageDataTable GetMessageByRequestID(int? RequestID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[6];
			if (RequestID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = RequestID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			S_Message.HLShop_MessageDataTable hLShop_MessageDataTable = new S_Message.HLShop_MessageDataTable();
			this.Adapter.Fill(hLShop_MessageDataTable);
			return hLShop_MessageDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Message.HLShop_MessageDataTable GetMessageByShopIDLately(int? ShopID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[7];
			if (ShopID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = ShopID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			S_Message.HLShop_MessageDataTable hLShop_MessageDataTable = new S_Message.HLShop_MessageDataTable();
			this.Adapter.Fill(hLShop_MessageDataTable);
			return hLShop_MessageDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Message.HLShop_MessageDataTable GetMessageByStatusContentBDateEDateProductyIDShopIDType(string M_Status, string M_Content, string M_BeginDate, string M_endDate, int? M_productid, int? M_shopid, int? M_Type)
		{
			this.Adapter.SelectCommand = this.CommandCollection[8];
			if (M_Status == null)
			{
				this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[1].Value = M_Status;
			}
			if (M_Content == null)
			{
				this.Adapter.SelectCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[2].Value = M_Content;
			}
			if (M_BeginDate == null)
			{
				this.Adapter.SelectCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[3].Value = M_BeginDate;
			}
			if (M_endDate == null)
			{
				this.Adapter.SelectCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[4].Value = M_endDate;
			}
			if (M_productid.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[5].Value = M_productid.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[5].Value = System.DBNull.Value;
			}
			if (M_shopid.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[6].Value = M_shopid.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[6].Value = System.DBNull.Value;
			}
			if (M_Type.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[7].Value = M_Type.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[7].Value = System.DBNull.Value;
			}
			S_Message.HLShop_MessageDataTable hLShop_MessageDataTable = new S_Message.HLShop_MessageDataTable();
			this.Adapter.Fill(hLShop_MessageDataTable);
			return hLShop_MessageDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Message.HLShop_MessageDataTable GetMessageForBuyer(int? Type, string userType, int? userID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[9];
			if (Type.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[1].Value = Type.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
			}
			if (userType == null)
			{
				this.Adapter.SelectCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[2].Value = userType;
			}
			if (userID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[3].Value = userID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[3].Value = System.DBNull.Value;
			}
			S_Message.HLShop_MessageDataTable hLShop_MessageDataTable = new S_Message.HLShop_MessageDataTable();
			this.Adapter.Fill(hLShop_MessageDataTable);
			return hLShop_MessageDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Message.HLShop_MessageDataTable GetMessageForSalerBySalerID(int? Type, int? SalerID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[10];
			if (Type.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = Type.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (SalerID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[1].Value = SalerID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
			}
			S_Message.HLShop_MessageDataTable hLShop_MessageDataTable = new S_Message.HLShop_MessageDataTable();
			this.Adapter.Fill(hLShop_MessageDataTable);
			return hLShop_MessageDataTable;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(S_Message.HLShop_MessageDataTable dataTable)
		{
			return this.Adapter.Update(dataTable);
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(S_Message dataSet)
		{
			return this.Adapter.Update(dataSet, "HLShop_Message");
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow dataRow)
		{
			return this.Adapter.Update(new DataRow[]
			{
				dataRow
			});
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow[] dataRows)
		{
			return this.Adapter.Update(dataRows);
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int DeleteMessage(int? M_ID)
		{
			SqlCommand sqlCommand = this.CommandCollection[1];
			if (M_ID.HasValue)
			{
				sqlCommand.Parameters[1].Value = M_ID.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Insert, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int InsertMessage(int? M_Type, int? M_Productid, int? M_ShopID, int? M_UserID, bool? M_Status, string M_Content, string M_SenderName, int? M_ReceiverID, string M_ReceiverName, string M_UserType, int? M_RequestID)
		{
			SqlCommand sqlCommand = this.CommandCollection[11];
			if (M_Type.HasValue)
			{
				sqlCommand.Parameters[0].Value = M_Type.Value;
			}
			else
			{
				sqlCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (M_Productid.HasValue)
			{
				sqlCommand.Parameters[1].Value = M_Productid.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			if (M_ShopID.HasValue)
			{
				sqlCommand.Parameters[2].Value = M_ShopID.Value;
			}
			else
			{
				sqlCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (M_UserID.HasValue)
			{
				sqlCommand.Parameters[3].Value = M_UserID.Value;
			}
			else
			{
				sqlCommand.Parameters[3].Value = System.DBNull.Value;
			}
			if (M_Status.HasValue)
			{
				sqlCommand.Parameters[4].Value = M_Status.Value;
			}
			else
			{
				sqlCommand.Parameters[4].Value = System.DBNull.Value;
			}
			if (M_Content == null)
			{
				sqlCommand.Parameters[5].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[5].Value = M_Content;
			}
			if (M_SenderName == null)
			{
				sqlCommand.Parameters[6].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[6].Value = M_SenderName;
			}
			if (M_ReceiverID.HasValue)
			{
				sqlCommand.Parameters[7].Value = M_ReceiverID.Value;
			}
			else
			{
				sqlCommand.Parameters[7].Value = System.DBNull.Value;
			}
			if (M_ReceiverName == null)
			{
				sqlCommand.Parameters[8].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[8].Value = M_ReceiverName;
			}
			if (M_UserType == null)
			{
				sqlCommand.Parameters[9].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[9].Value = M_UserType;
			}
			if (M_RequestID.HasValue)
			{
				sqlCommand.Parameters[10].Value = M_RequestID.Value;
			}
			else
			{
				sqlCommand.Parameters[10].Value = System.DBNull.Value;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int ReplayMessage(string M_Content, int? M_UserID, int? M_ID, string M_SenderName)
		{
			SqlCommand sqlCommand = this.CommandCollection[12];
			if (M_Content == null)
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = M_Content;
			}
			if (M_UserID.HasValue)
			{
				sqlCommand.Parameters[2].Value = M_UserID.Value;
			}
			else
			{
				sqlCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (M_ID.HasValue)
			{
				sqlCommand.Parameters[3].Value = M_ID.Value;
			}
			else
			{
				sqlCommand.Parameters[3].Value = System.DBNull.Value;
			}
			if (M_SenderName == null)
			{
				sqlCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[4].Value = M_SenderName;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
	}
}
